import asyncio
import time

from aiohttp import ClientResponse

from requests_by_async.RequestsByAsync import RequestsByAsync


async def functionCallback(response:  ClientResponse):
    s = await response.text()
    print(time.time())

async def main():
    url_list = [
        'https://example.com/api',
    ] * 100
    requests = RequestsByAsync(
        url_list=url_list,
        request_method="Get",
        headers={'User-Agent': 'Mozilla/5.0'},
        cookies={'cookie': 'value'},
        params={'param': 'value'},
        callback=functionCallback,
    )
    await requests.start()


if __name__ == '__main__':
    start_time = time.time()
    asyncio.run(main())

    print(time.time() - start_time)

